package com.ysynzehao.dubbo.order.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Service;
import com.ysynzehao.dubbo.order.dao.OrderMapper;
import com.ysynzehao.dubbo.order.model.Order;
import com.ysynzehao.dubbo.service.order.OrderService;

@Component
@Service
public class OrderServiceImpl implements OrderService {
	
	@Autowired
	private OrderMapper orderMapper;

	public Order getOrder(Long odid) {
		return orderMapper.selectByPrimaryKey(odid);
	}

	public boolean saveOrder(Order order) {
		int result = orderMapper.insert(order);
		if (result > 0) {
			return true;
		} else {
			return false;
		}
	}

}
